<template>
	<ul>
		<li v-for="(message, index) in messages" :key="message.id">{{message.title}}</li>
	</ul>
</template>

<script>
	export default {
		data() {
			return {
				messages:[]
			}
		},
		mounted() {
			// 模拟ajax从后台获取数据
			setTimeout(() => {
				const messages = [
					{id:1, title:'message001'},
					{id:2, title:'message002'},
					{id:3, title:'message003'},
					{id:4, title:'message004'},
					{id:5, title:'message005'},
					{id:6, title:'message006'}
				];
				this.messages = messages;
			}, 1000);
		}
	}
</script>

<style>
</style>
